package com.siki.pojo.commonEntity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.siki.pojo.base.BaseEntity;
import com.siki.pojo.enumeration.common.EducationClaim;
import com.siki.pojo.enumeration.common.PositionCategory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import java.util.List;

/**
 * @author siki
 * @Date 2020/06/06
 */
@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel("岗位实体")
@Table(name = "talent_position")
@TableName(value = "talent_position",resultMap = "com.siki.mapper.CommonMap.talentPositionResult")
@Entity
public class TalentPosition extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "职位名称")
    private String positionName;

    @ApiModelProperty(value = "职位的类别")
    @Enumerated(EnumType.STRING)
    private PositionCategory positionCategory;

    @ApiModelProperty(value = "最高工资")
    private String maximumWage;

    @ApiModelProperty(value = "最低工资")
    private String minimumWage;

    @ApiModelProperty(value = "工作地点")
    private String workPlace;

    @ApiModelProperty(value = "学历要求")
    @Enumerated(EnumType.STRING)
    private EducationClaim educationClaim;

    @ApiModelProperty(value = "职位特点")
    private String positionFeatures;

    @ApiModelProperty(value = "职位描述")
    private String positionDescription;

    @ApiModelProperty(value = "是否发布")
    private Boolean released;

    @ApiModelProperty("企业")
    @ManyToOne
    @TableField(exist = false)
    Enterprise enterprise;

    @ApiModelProperty("投诉的用户")
    @ManyToMany
    @JoinTable(name="general_user_talent_position",joinColumns={@JoinColumn(name="tp_id")},inverseJoinColumns={@JoinColumn(name="gu_id")})
    @TableField(exist = false)
    List<GeneralUser> complaintGeneralUsers;

    @ApiModelProperty("应聘的用户")
    @ManyToMany
    @TableField(exist = false)
    @JoinTable(name="apply_general_position",joinColumns={@JoinColumn(name="tp_id")},inverseJoinColumns={@JoinColumn(name="gu_id")})
    List<GeneralUser> applyGeneralUsers;
}
